package cn.iocoder.yudao.module.tms.controller.admin.companyaccountperiod.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDate;
import jakarta.validation.constraints.*;

@Schema(description = "管理后台 - 公司账期信息新增/修改 Request VO")
@Data
public class CompanyAccountPeriodSaveReqVO {

    @Schema(description = "主键", example = "1024")
    private Long id;

    @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
    @NotNull(message = "公司ID不能为空")
    private Long companyId;

    @Schema(description = "授信额度（元）", requiredMode = Schema.RequiredMode.REQUIRED, example = "500000")
    @NotNull(message = "授信额度不能为空")
    @DecimalMin(value = "0.00", message = "授信额度必须大于等于0")
    private BigDecimal creditLimit;

    @Schema(description = "授信预警金额（元）", requiredMode = Schema.RequiredMode.REQUIRED, example = "550000")
    @NotNull(message = "授信预警金额不能为空")
    @DecimalMin(value = "0.00", message = "授信预警金额必须大于等于0")
    private BigDecimal creditAlertAmount;

    @Schema(description = "当前合作金额（元）", example = "200000")
    @DecimalMin(value = "0.00", message = "当前合作金额必须大于等于0")
    private BigDecimal currentCreditUsed;

    @Schema(description = "账期天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "40")
    @NotNull(message = "账期天数不能为空")
    @Min(value = 1, message = "账期天数必须大于0")
    private Integer billingCycleDays;

    @Schema(description = "账期提前提醒天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7")
    @NotNull(message = "账期提前提醒天数不能为空")
    @Min(value = 0, message = "账期提前提醒天数不能小于0")
    private Integer billingAlertDays;

    @Schema(description = "账期开始日期", example = "2025-01-01")
    private LocalDate billingStartDate;

    @Schema(description = "账期到期日期", example = "2025-02-10")
    private LocalDate billingDueDate;

    @Schema(description = "备注", example = "一季度账期配置")
    private String remark;

}
